<template>
	
	<view class="bg-img bg-mask flex align-center"
		style="background-image: url('https://t.mwm.moe/fj/');height: 414upx;">
		<view class="padding-xl text-white">
			<view class="padding-xs text-xxl text-bold">
				我的积分：{{user.integral}}
			</view>
			<view class="padding-xs text-lg">
				<view>积分抽奖获得</view>
				<view>可用于店内抵消金额</view>
			</view>
		</view>
	</view>
	<view class="fen1">
		
	</view>
	
</template>

<script>
	export default {
		data() {
			return {
				token:'',
				user:{}
			};
		},
		onLoad() {
			this.token = uni.getStorageSync("token")
			if (this.token == '') {
				uni.showToast({
					title: '请先登录',
					icon: "error"
				});
				uni.navigateTo({
					url: '../login/login'
				});
			
			}
			var that = this
			uni.request({
				method: "POST",
				url: "http://127.0.0.1:9000/user/findOneUser",
				header: {
					Authorization: this.token
				},
				success(res) {
					that.user = res.data.data.user
					console.log(res.data.data.user);
				}
			})
		}
	}
</script>

<style lang="less">
	page{
		padding: 40rpx;
		background-color: white;
	}
	.fen{
		text-align: center;
		height: 100rpx;
		line-height: 100rpx;
	}
	.fen1{
		display: flex;
		
	}
</style>
